package com.woorigil.android.sample.activity.product.list;

import com.woorigil.android.sample.activity.product.ProductListActivity;
import com.woorigil.android.sample.domain.product.DealListResult;


public class ProductListFragmentFactory {
	private ProductListActivity activity;
	private DealListResult dealListBox;
	
	public ProductListFragmentFactory(ProductListActivity activity, DealListResult dealListBox) {
		this.activity = activity;
		this.dealListBox = dealListBox;
	}
	
	public ProductListFragment get(int position) {
		if (position == 0) {
			return CategoryProductListFragment.newInstance(activity, dealListBox.getCategoryDeals());
		} else {
			return PopularListFragment.newInstance(activity, dealListBox.getNewDeals());
		}
	}
	
	public int getCount() {
		return 2;
	}
}
